﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using Garlic.CC.BaseClass;
using Garlic.CC.Utility;
using Garlic.BLL.Common;
using Garlic.DM.DataModel;
using Garlic.CC.WebUtility;
using Garlic.BLL;


public partial class SystemManagement_CodeAdd : BasePage
{
    

    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            this.formCodeList.DefaultMode = FormViewMode.Insert;
        }
    }

    private void ShowMessage(string msg)
    {
        this.Message = msg;
    }

    protected void TopToolBar_OnClick(object sender, Garlic.UI.Components.IconButtonClickEventArgs args)
    {
        switch (args.Command)
        {
            case ToolbarCommand.Save:
                try
                {
                    this.formCodeList.InsertItem(true);
                    //如果没有出异常，说明插入成功
                    //立即关闭当前窗口
                    this.CloseVirtualWindow(true);
                }
                catch(Exception ex)
                {
                    this.Message = ex.InnerException.Message;
                }
                break;
        }
    }
    
}
